package com.base.hong.ext

import android.content.Context
import android.content.res.Resources
import android.util.TypedValue


val Number.dp: Int get() = (this.toFloat() * Resources.getSystem().displayMetrics.density).toInt()

fun dpToPx(dp: Float, context: Context): Float {
    return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, context.resources.displayMetrics)
}
